﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RPGProject.GameWorld;
namespace RPGProject.LoopSystem
{
    /// <summary>
    /// Loop to update the world for a turn.
    /// </summary>
    class WorldTurnLooper : Loop
    {
        private World world;
        /// <summary>
        /// Construct one from the world specified.
        /// </summary>
        /// <param name="w"></param>
        /// <param name="lm"></param>
        public WorldTurnLooper(World w, LoopManager lm)
            : base(lm)
        {
            this.world = w;
        }
        /// <summary>
        /// Updates the world for a turn.
        /// </summary>
        /// <returns></returns>
        public override FuncType RunOnce()
        {
            this.world.Update(false);
            return FuncType.ADD_TO_END;
        }
    }
}
